package org.cskj.demo.service.imp;

import org.cskj.demo.mapper.InshopMapper;
import org.cskj.demo.pojo.Inshop;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class InshopService {
    @Autowired
    private InshopMapper inshopMapper;
    public List<Inshop> selectAll(int page,int pagesize){
        Map map=new HashMap();
        map.put("start",(page-1)*pagesize);
        map.put("end",pagesize);
        List<Inshop> list = inshopMapper.selectAll(map);
        return list;
    }
    public int count(){
        int i = inshopMapper.countByExample(null);
        return i;
    }
    public int insert(Inshop inshop){
        int i = inshopMapper.insertSelective(inshop);
        return i;
    }
}
